class AdminController < ApplicationController
  def login
    if request.post?
      user = User.authenticate(params[:name], params[:password])
      if user
        session[:user] = user
        redirect_to :controller => "home", :action => 'signed_in'
      else
        flash[:notice] = "Invalid user/password combination"
        redirect_to :action => "login"
      end
    end
  end

  def logout
    reset_session
    redirect_to :controller => "game"
  end

end
